<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>订阅</title>
</head>
<body>
<?php
/**
 * @author Wangtao
 * @version 
 */
define('IN_WT', true);
require 'include.php';
require 'config.php';
//echo $_GET['rss'];
#连接数据库
$db = mysqlDB::con();

#从页面获得源
$rss = http::get('rss');

#读取博客信息
#$blog = wt_xml::readInfo($rss);

#读取RSS
$xmls = new wt_xml($rss);
$blog = $xmls->getRss($rss);
#print_r($blog);exit;

#博客信息
#$bloginfo = $table['info'];
//print_r($bloginfo);
#文章
#$posts = $table['post'];
//print_r($posts);exit;

#加入新源
if (!wt_post::addRss($rss, $blog))
{
	die('已经加入此源了');
}
if (empty($blog['post']))
{
	die('错误');
}

#加入新文章
wt_post::addPostNew($rss, $blog['post']);
?>
</body>
</html>
<?php
//print_r($posts);
#test
//print_r($post);
/*echo '<div id="post">';
foreach ($post as $value)
{
	echo '<div id="pp">';
	echo '<div>';
	echo '<a href="' . $value['link'] . '">' . $value['title'] . '</a>';
	echo '</div>';
	echo '<div>';
	echo '<small>作者：' . $value['dc_creator'] . '</small>';
	echo '<small>' . $value['pubDate'] . '</small>';
	echo '</div>';
	echo $value['content_encoded'];
	echo '</div>';
}
echo '</div>';
#将文章解析成HTML
function postToHtml($post)
{
}*/
?>